package com.example.demomk.entity;

import androidx.room.Embedded;
import androidx.room.Relation;

import java.util.List;

public class AvgMeasurementWithMeasurements {
    @Embedded
    public AvgMeasurement avgMeasurement;


    @Relation(
            parentColumn = "id",  // AvgMeasurement 的 id
            entityColumn = "parent_id"  // Measurement 的 parent_id
    )
    public List<Measurement> measurements;

    @Relation(
            parentColumn = "user_id",   // 关联字段：avg_measurement.userId
            entityColumn = "id"        // 对应 user.id
    )
    public User user;
    @Relation(
            parentColumn = "location_id",   // 关联字段：avg_measurement.locationId
            entityColumn = "id"        // 对应 location.id
    )
    public Location location;
}